﻿using Autofac;
using Microsoft.AspNetCore.Builder;
using xjjxmm.infrastructure.Middleware.RateLimit;
using xjjxmm.infrastructure.Middleware.RepeatSubmit;

namespace xjjxmm.infrastructure.compont;

public class RepeatSubmitCompont : ICompont
{
    public int Order { get; set; } = 1200;

    public bool Regist(ContainerBuilder builder)
    {
        builder.RegisterType<RepeatSubmitMiddleware>().SingleInstance();
        return false;
    }

    public bool Use(WebApplication app)
    {
        app.UseMiddleware<RepeatSubmitMiddleware>();

        return true;
    }
}
